#include "../Header/Game.h"
#include "../Header/Entities/Image2D.h"

Game* Game::m_instance = NULL;

Game* Game::GetInstance()
{
	if (!m_instance)
		m_instance = new Game();
	return m_instance;
}

void Game::DestroyInstance()
{
	LOGI("Game destroy instnace\n");
	SAFE_DEL(m_instance);
}

_utInt32 Game::Init()
{
	LOGI("Game initializa\n");
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
	entity = new Image2D();
	entity->Init();
	return 0;
}

void Game::Destroy()
{
	LOGI("Game destroy data\n");
	entity->Destroy();
	SAFE_DEL(entity);
}

void Game::Update(float deltaTime)
{
	entity->Update(deltaTime);
}

void Game::Draw()
{
	glClear(GL_COLOR_BUFFER_BIT);
	entity->Draw();
}

void Game::Key(unsigned char key, bool status)
{

}

void Game::Selected()
{
	LOGI("Change grayscale\n");
	EnableGrayScale();
}